package com.prj.ufdm.demo.tutorial.despatterns.behavioral.strategy;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 抽象类，记录发送日志
 * @author Administrator
 */
public abstract class SMSSendAbstract  {

	public void sendLog(String content) {
		try {
			Date currentDate = new Date();
			SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			System.out.println(InetAddress.getLocalHost().getHostAddress() + " 在 "+ formatter.format(currentDate) + " 发送了短信，短信内容："+content);
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
	}

}
